package com.james.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * Created by James on 2018-01-15.
 */
@RestController
public class GoodsController {
    @Autowired
    private RestTemplate restTemplate;
    @RequestMapping("/hi")
    public String home(){
//        LOG.log(Level.INFO, "hi is being called");
        return "hi i'm zipkin-goods";
    }

    @RequestMapping("/goods")
    public String info(){
//        LOG.log(Level.INFO, "info is being called");
        return restTemplate.getForObject("http://localhost:8988/info",String.class);
    }
}
